package com.it.homework;

//学生测试类
public class StudentText {
    public static void main(String[] args) {
        //无参构造方法
        //创建zg学生对象或者是说实例化学生对象
        Student zg = new Student();

        //访问成员变量，并赋值
        zg.name = "张港";
        zg.age = 18;
        zg.className = "java20240328";
        zg.stuId = "001";

        //访问成员方法
        zg.study();
        zg.sayHi();
        zg.playWith("李林");

        System.out.println("----------------");

        //全参构造方法
        //相当于构造方法的同时直接赋值数据
        Student ll = new Student("李林", 20, "java20240328", "002");

        //访问成员方法
        ll.study();
        ll.sayHi();
        ll.playWith("张港");

        System.out.println("----------------");

    }
}
